<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Off the Record</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
</head>
<script type="text/javascript">
	$(document).ready(function(){
		$( "#search" ).autocomplete({
			source:function(request, response){
				$.ajax({
					type:"post",
					url:"/OffTheRecord/searchCompanyByName2.action",
					data:"companyName="+request.term,
					
					success:function(data){
						response(data.cnameList);
					}//callback
				});//ajax
			}//function
		});//autocomplete

		$('#searchBtn').click(function(){
			$('#report_content').html($('#search').val());
		});
	});
	
	function applyMentor() {
		var frm = document.mentorForm;
		
		if(frm.reportContent.value == "")
			alert("회사를 선택해주세요!");
		var i = confirm("신청하시겠습니까?");
		if(i){
			frm.submit();
		}
	}
</script>
<body>
<c:import url="../common/top.jsp"></c:import>
<div class="container" style="margin: 60px;"></div>
<div class="container">
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4"></div>

<!--  -->
<div style="border: 1px solid lightgray; border-radius: 5px; padding: 10px;">
	<div class="ui-widget">
		기업 검색
		<input type="text" id="search">
		<input type="button" value="확인" id="searchBtn">
	</div>
	
	<form action="/OffTheRecord/mentorReport.action" name="mentorForm" method="post">
	<font color="yellowgreen"><textarea id="report_content" name="reportContent" style="border: 0;"></textarea></font><p>
	자동완성이 되지 않을 경우 메인페이지 하단 <a href="/OffTheRecord/index/index.jsp">건의하기</a>에서 회사 등록 요청을 해주세요.
	<input type="hidden" name="adminId" id="admin_id" value="${sessionScope.userVo.adminVo.adminId }" readonly="readonly"><p>
	<input type="hidden" name="reportTarget" id="report_target" value="멘토 신청 쪽지임">
	<input type="button" value="신청" onclick="applyMentor()">
	</form>
</div>
<!--  -->

<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4"></div>
</div><!-- row -->
</div><!-- container -->
</body>
</html>